home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1986 January & February
/
rerun-1986-01-02.d64
/
credit cards 64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
5KB
|
148 lines
5 rem mod.credit card
50 poke53280,15:poke53281,15:printchr$(14)"[147]"
100 fi$="[195]redit [195]ard [198]ile":l=12
110 m$(1)=" [152][206]ext [152][208]revious [152][205]enu "
115 m$(2)="[152] [163] [163] [163]"
120 s=25:dim cn$(s),no$(s),ed$(s),ty$(s)
130 m$(3)="[212]here are no [208][210][201][207][210] [197]ntries for [195]ategory"
140 m$(4)="[212]here are no [205][207][210][197] [197]ntries for [195]ategory"
150 cl$=" "
170 print""fi$"by [205]ichael [210]eich"
175 print"[152][201]nstructions? [y/n]"
180 geta$:ifa$=""then180
185 ifa$="[217]"ora$="y"thengosub6000
190 goto300
200 rem screen locater & page header
202 rem * * * * * * * * * * * * * * * *
210 print"";
220 ify<>0thenpoke214,y-1:print
230 poke211,x:return
240 rem
250 print"[147]":x=l:y=1:gosub200:printfi$:x=15:y=3:gosub200:print"[205]enu"
260 return
300 rem read file
302 rem * * * * * * * * * * * * * * * *
320 readty$:ifty$="end"then390
330 readcn$,no$,ed$,a1$,a2$
340 ifty$="[199]"thenen$(0,g)=cn$+no$+ed$+a1$+a2$:g=g+1
350 ifty$="[211]"thenen$(1,ss)=cn$+no$+ed$+a1$+a2$:ss=ss+1
360 ifty$="[207]"thenen$(2,o)=cn$+no$+ed$+a1$+a2$:o=o+1
370 goto320
380 rem
390 goto4000
400 rem print file
402 rem * * * * * * * * * * * * * * * *
410 print"[147]":rem print page header
420 form=x1tox2:forn=0toy1
430 cn$=left$(en$(m,n),18):no$=mid$(en$(m,n),19,19):ed$=mid$(en$(m,n),38,5)
435 a1$=mid$(en$(m,n),43,20):a2$=right$(en$(m,n),8)
440 print"":ifcn$=""then560
450 print"[152][195]ard [206]ame: [146] "cn$:print
460 print"[152][195]ard [206]umber: [146] "no$:print
470 print"[152][197]xp. [196]ate: [146] "ed$:print
475 print"[152][193]ddress: [146] "a1$:printtab(15)a2$
480 x=0:y=22:gosub200:printm$(1)+m$(2)
490 k=0:geta$:ifa$=""then490
495 a=asc(a$)
500 ifa=77ora=205 thengosub250:return
503 ifa$="[208]"ora$="p"thenifc=1then565
504 ifa$="[208]"ora$="p"thenn=n-2:ifn>=-1then560
505 ifc>1thenifn<0thenx= 0:y=15:gosub200:printm$(3):fork=0to2000:next
510 ifkthenx=0:y=15:gosub200:printcl$:n=n+2:goto490
530 ifa$<>"[206]"anda$<>"n"then490
535 ifc=1thenifn+1>=y1then570
540 ifn+1>=y1thenx=0:y=15:gosub200:printm$(4):fork=0to2000:next
550 ifkthenx=0:y=15:gosub200:printcl$:goto490
560 ifc<>1then nextn
565 ifc=1thenif(a$="[208]"ora$="p")thenif(n>0 andn<=g)thenn=n-1:goto430
567 ifc=1thenif(a$="[208]"ora$="p")thenifn=0thenm=m-1:n=g:ifm>=0then430
568 ifc=1thenifm<0thenx=0:y=15:gosub200:printm$(3):fork=0to2500:next
569 ifkthenx=0:y=15:gosub200:printcl$:gosub250:return
570 ifc=1thenifn<gthennextn
572 ifc=1thenifm<>x2then nextm
575 ifc=1thenifm=x2thenx=0:y=15:gosub200:printm$(4):fork=0to2000:next:goto550
580 goto490
1000 rem data
1003 rem ******************************* gasoline
1005 :
1010 data"[199]","[208]hillips [208]etroleum","123-456-789-0 ",11/85
1015 data"[208][207][194]ox77,[194]artlesville","[207][203] 74004"
1020 data"[199]","[212]otal [208]etroleum ","12345-678-90123 ","none "
1025 data"[193]lma ","[205][201] 48801"
1030 data"[199]","[199]ulf [207]il [195]orp. ","12345-67890 ",03/85
1035 data" "," "
1099 rem ******************************* stores
1100 data"[211]","[211]ears [210]oebuck & [195]o","1-23456-78901-2 ","none "
1105 data" "," "
1110 data"[211]","[202][195] [208]enney ","123-456-789-0 ","none "
1115 data" "," "
1120 data"[211]","[205]ontgomery [215]ard ","123-456-789-0123 ","none "
1125 data" "," "
1199 rem ******************************* other
1200 data"[207]","[205]aster [195]harge-[201]owa","1234-5678-9012-3456",03/84
1205 data"[208][207][194]ox14361,[207]maha ","[206][197] 68114"
1210 data"[207]","[201]nstant [195]ash ","1234-5678-9012345 ","none "
1215 data"[208][207][194]ox[194]-1608,[205]inneap.","[205][206] 55480"
2099 data end
4000 rem * * * * * * * * * * * * * * * *
4002 rem bubble sort
4010 print"[147]"tab(10)"[193]lphabetizing"
4015 print""tab(10)"[193]ll [196]ata":printtab(10)"[208]lease [215]ait"
4020 form=0to2:kk=0:n=g:ifm=1thenn=ss
4025 ifm=2thenn=o
4030 fori=0ton-1:ifen$(m,i+1)=""thenkk=kk+1:goto4140
4040 ifen$(m,i)>en$(m,i+1)thenk=1:goto4090
4050 ifen$(m,i)<=en$(m,i+1)thenk=0:goto4140
4090 t$=en$(m,i):en$(m,i)=en$(m,i+1):en$(m,i+1)=t$
4140 nexti:ifkk<>n-1then4025
4160 nextm:goto5000
5000 rem * * * * * * * * * * * * * * * *
5002 rem menu 1
5020 gosub250
5030 x=10:y=5:gosub200:print" [211]elect: "
5040 y=7:gosub200:print"[152]1 [210]eview [198]ile":y=9:gosub200:print"[152]2 [213]pdate"
5050 y=11:gosub200:print"[152]3 [209]uit"
5060 geta$:a=val(a$):ifa<1ora>3then5060
5070 onagoto5200,5090,5100
5080 goto5060
5090 list1000-4000
5100 rem * * * * * * * * * * * * * * * *
5102 rem quit
5110 print"[147]"chr$(142):end
5200 rem * * * * * * * * * * * * * * * *
5202 rem review file menu (2)
5205 :
5210 print"":forx=5to11step2:printcl$:next
5220 x=10:y=5:gosub200:print"[210]eview:"
5230 y=7:gosub200:print"[152]1 [193]ll":y=9:gosub200:print"[152]2 [199]asoline"
5240 y=11:gosub200:print"[152]3 [211]tores":y=13:gosub200:print"[152]4 [207]ther"
5250 y=15:gosub200:print"[152]5 [209]uit"
5260 c=0:getc$:c=val(c$):ifc<1orc>5then5260
5270 ifc=5then5000
5280 ifc=1thenx1=0:x2=2:y1=g
5290 ifc=2thenx1=0:x2=0:y1=g
5300 ifc=3thenx1=1:x2=1:y1=ss
5310 ifc=4thenx1=2:x2=2:y1=o
5330 gosub400:goto5200
6000 rem * * * * * * * * * * * * * * * *
6002 rem instructions
6003 rem * * * * * * * * * * * * * * * *
6010 print"[147]"fi$"-[201]nstructions"
6030 print"[196]ata for each credit card is entered"
6040 print"beginning at line 1000."
6050 print"[197]ach card has the following entries:"
6060 printtab(5)"[212]ype[152] ([199] for gasoline, [211] for [211]tore, [207] for [207]ther)"
6070 printtab(5)"[206]ame of card[152] (up to 18 letters)"
6080 printtab(5)"[195]ard [206]umber[152] ( up to 19 numbers)"
6090 printtab(5)"[197]xpiration [196]ate[152] (up to 5 char- acters)"
6095 printtab(5)"[193]ddress[152] (up to 39 characters in two lines)"
6100 print"[198]or example, here is a sample entry-"
6110 cr$=chr$(34)
6120 printtab(5)"data "cr$"[199]"cr$","cr$"[195]onoco "cr$","
6125 printtab(5)cr$"xx-xxx-xxxx "cr$","cr$"05/85"cr$
6130 printtab(5)"data "cr$"1234 [205]ain [211]t.,[212]ampa "cr$","spc(20)cr$"[198][204] 11111"cr$
6140 print"[152][210]e-save the entire program after entering new data"
6150 printtab(8)"[152][208]ress any key to continue"
6160 geta$:ifa$=""then6160
6170 return